﻿<UserControl
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:d="http://schemas.microsoft.com/expression/blend/2006"
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
	xmlns:properties="clr-namespace:ViewOn.Properties"
	mc:Ignorable="d"
	x:Class="ViewOn.UI.Dialog.EqualizerControl"
    Width="480"
	Height="100">
	<UserControl.Resources>
	
		<Style x:Key="EqualizerSliderButtonStyle" TargetType="{x:Type RepeatButton}">
			<Setter Property="SnapsToDevicePixels" Value="true"/>
			<Setter Property="OverridesDefaultStyle" Value="true"/>
			<Setter Property="IsTabStop" Value="false"/>
			<Setter Property="Focusable" Value="false"/>
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="{x:Type RepeatButton}">
						<Border Background="Transparent" />
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>

		<Style x:Key="EqualizerSliderThumbStyle" TargetType="{x:Type Thumb}">
			<Setter Property="SnapsToDevicePixels" Value="true"/>
			<Setter Property="OverridesDefaultStyle" Value="true"/>
			<Setter Property="Focusable" Value="false"/>
			<Setter Property="Height" Value="14"/>
			<Setter Property="Width" Value="14"/>
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="{x:Type Thumb}">
						<Border
							x:Name="Ellipse"
							CornerRadius="1,1,1,1"
							Background="#FF434343"
							BorderBrush="#FF1A1A1A"
							BorderThickness="1" RenderTransformOrigin="0.5,0.5" Width="24" Height="8" HorizontalAlignment="Stretch" >
							<Border.RenderTransform>
								<TransformGroup>
									<ScaleTransform ScaleX="1" ScaleY="1"/>
									<SkewTransform AngleX="0" AngleY="0"/>
									<RotateTransform/>
									<TranslateTransform X="0" Y="0"/>
								</TransformGroup>
							</Border.RenderTransform>
						</Border>
						<ControlTemplate.Triggers>
							<Trigger Property="IsMouseOver" Value="True">
								<Setter TargetName="Ellipse" Property="Background" Value="{DynamicResource VOColor02}"/>
							</Trigger>
						</ControlTemplate.Triggers>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>

		<ControlTemplate x:Key="EqualizerVerticalSlider" TargetType="{x:Type Slider}">
			<Grid>
					<Grid.ColumnDefinitions>
						<ColumnDefinition Width="Auto"/>
						<ColumnDefinition Width="Auto" MinWidth="{TemplateBinding MinWidth}"/>
						<ColumnDefinition Width="Auto"/>
					</Grid.ColumnDefinitions>
					<StackPanel Height="63" HorizontalAlignment="Center" Width="8" Grid.Column="1" Orientation="Horizontal" Margin="0,0,3,0">
						<Border
							x:Name="TrackBackground"
							Height="63"
							BorderBrush="{DynamicResource VOColor13}"
							BorderThickness="1,0,0,0" Width="1" />
					</StackPanel>
					<TickBar
						x:Name="TopTick"
						SnapsToDevicePixels="True"
						Placement="Top"
						Fill="Transparent"
						Height="4"
						Visibility="Collapsed" />
					<Track Grid.Column="1" x:Name="PART_Track">
						<Track.DecreaseRepeatButton>
							<RepeatButton
								Style="{StaticResource EqualizerSliderButtonStyle}"
								Command="Slider.DecreaseLarge"/>
						</Track.DecreaseRepeatButton>
						<Track.IncreaseRepeatButton>
							<RepeatButton
								Style="{StaticResource EqualizerSliderButtonStyle}"
								Command="Slider.IncreaseLarge"/>
						</Track.IncreaseRepeatButton>
						<Track.Thumb>
							<Thumb Style="{StaticResource EqualizerSliderThumbStyle}" Width="26" />
						</Track.Thumb>
					</Track>
					<TickBar
						x:Name="BottomTick"
						SnapsToDevicePixels="True"
						Grid.Column="2"
						Fill="{TemplateBinding Foreground}"
						Placement="Bottom"
						Height="4"
						Visibility="Collapsed" />
					<Grid Grid.Column="1" Grid.ColumnSpan="3" HorizontalAlignment="Center">
						<Grid.RowDefinitions>
							<RowDefinition/>
							<RowDefinition/>
							<RowDefinition/>
							<RowDefinition/>
							<RowDefinition/>
							<RowDefinition/>
							<RowDefinition/>
							<RowDefinition/>
							<RowDefinition/>
						</Grid.RowDefinitions>
						<Path Width="6" Height="1" Fill="{DynamicResource VOColor15}" Stretch="Fill" Stroke="{DynamicResource VOColor15}" Data="M20,0 40,0" VerticalAlignment="Top" d:LayoutOverrides="GridBox" HorizontalAlignment="Center" Visibility="Hidden"/>
						<Path Width="6" Height="1" Fill="{DynamicResource VOColor15}" Stretch="Fill" Stroke="{DynamicResource VOColor15}" Data="M20,0 40,0" VerticalAlignment="Top" d:LayoutOverrides="GridBox" Grid.Row="1" HorizontalAlignment="Center"/>
						<Path Width="6" Height="1" Fill="{DynamicResource VOColor15}" Stretch="Fill" Stroke="{DynamicResource VOColor15}" Data="M20,0 40,0" VerticalAlignment="Top" d:LayoutOverrides="GridBox" Grid.Row="2" HorizontalAlignment="Center"/>
						<Path Width="6" Height="1" Fill="{DynamicResource VOColor15}" Stretch="Fill" Stroke="{DynamicResource VOColor15}" Data="M20,0 40,0" VerticalAlignment="Top" d:LayoutOverrides="GridBox" Grid.Row="3" HorizontalAlignment="Center"/>
						<Path Width="6" Height="1" Fill="{DynamicResource VOColor15}" Stretch="Fill" Stroke="{DynamicResource VOColor15}" Data="M20,0 40,0" VerticalAlignment="Top" d:LayoutOverrides="GridBox" Grid.Row="4" HorizontalAlignment="Center"/>
						<Path Width="6" Height="1" Fill="{DynamicResource VOColor15}" Stretch="Fill" Stroke="{DynamicResource VOColor15}" Data="M20,0 40,0" VerticalAlignment="Top" d:LayoutOverrides="GridBox" Grid.Row="5" HorizontalAlignment="Center"/>
						<Path Width="6" Height="1" Fill="{DynamicResource VOColor15}" Stretch="Fill" Stroke="{DynamicResource VOColor15}" Data="M20,0 40,0" VerticalAlignment="Top" d:LayoutOverrides="GridBox" Grid.Row="6" HorizontalAlignment="Center"/>
						<Path Width="6" Height="1" Fill="{DynamicResource VOColor15}" Stretch="Fill" Stroke="{DynamicResource VOColor15}" Data="M20,0 40,0" VerticalAlignment="Top" Grid.Row="7" HorizontalAlignment="Center"/>
						<Path Width="6" Height="1" Fill="{DynamicResource VOColor15}" Stretch="Fill" Stroke="{DynamicResource VOColor15}" Data="M20,0 40,0" HorizontalAlignment="Center" VerticalAlignment="Top" Grid.Row="8"/>
					</Grid>
				</Grid>
			<ControlTemplate.Triggers>
				<Trigger Property="TickPlacement" Value="TopLeft">
					<Setter TargetName="TopTick" Property="Visibility" Value="Visible"/>
				</Trigger>
				<Trigger Property="TickPlacement" Value="BottomRight">
					<Setter TargetName="BottomTick" Property="Visibility" Value="Visible"/>
				</Trigger>
				<Trigger Property="TickPlacement" Value="Both">
					<Setter TargetName="TopTick" Property="Visibility" Value="Visible"/>
					<Setter TargetName="BottomTick" Property="Visibility" Value="Visible"/>
				</Trigger>
			</ControlTemplate.Triggers>
		</ControlTemplate>

		<Style x:Key="EqualizerSliderTemplate" TargetType="{x:Type Slider}">
			<Setter Property="SnapsToDevicePixels" Value="true"/>
			<Setter Property="OverridesDefaultStyle" Value="true"/>
			<Style.Triggers>
				<Trigger Property="Orientation" Value="Vertical">
					<Setter Property="MinWidth" Value="30" />
					<Setter Property="MinHeight" Value="21" />
					<Setter Property="Template" Value="{StaticResource EqualizerVerticalSlider}" />
				</Trigger>
			</Style.Triggers>
		</Style>
	
	</UserControl.Resources>
	<Grid>
		<Grid.ColumnDefinitions>
			<ColumnDefinition Width="40"/>
			<ColumnDefinition Width="80"/>
			<ColumnDefinition/>
			<ColumnDefinition/>
			<ColumnDefinition/>
			<ColumnDefinition/>
			<ColumnDefinition/>
			<ColumnDefinition/>
			<ColumnDefinition/>
			<ColumnDefinition/>
			<ColumnDefinition/>
			<ColumnDefinition/>
		</Grid.ColumnDefinitions>
		<Grid.RowDefinitions>
			<RowDefinition Height="17"/>
			<RowDefinition Height="5"/>
			<RowDefinition/>
			<RowDefinition Height="15"/>
		</Grid.RowDefinitions>
		<Slider IsEnabled="False"  Style="{StaticResource EqualizerSliderTemplate}" HorizontalAlignment="Left" VerticalAlignment="Stretch" Orientation="Vertical" Maximum="15" LargeChange="3" SmallChange="1" Grid.Row="2" x:Name="sliPreamp" Minimum="-15"/>
		<Slider IsEnabled="False"  Style="{StaticResource EqualizerSliderTemplate}" HorizontalAlignment="Left" VerticalAlignment="Stretch" Orientation="Vertical" Grid.Column="1" Maximum="100" LargeChange="10" SmallChange="5" Grid.Row="2" x:Name="sliBalance" Minimum="-100"/>
		<Slider IsEnabled="False" Style="{StaticResource EqualizerSliderTemplate}" HorizontalAlignment="Center" VerticalAlignment="Stretch" Orientation="Vertical" Grid.Column="2" Maximum="15" LargeChange="3" SmallChange="1" Grid.Row="2" x:Name="sli32" Minimum="-15"/>
		<Slider IsEnabled="False" Style="{StaticResource EqualizerSliderTemplate}" HorizontalAlignment="Center" VerticalAlignment="Stretch" Orientation="Vertical" Grid.Column="3" Maximum="15" LargeChange="3" SmallChange="1" Grid.Row="2" x:Name="sli64" Minimum="-15"/>
		<Slider IsEnabled="False" Style="{StaticResource EqualizerSliderTemplate}" HorizontalAlignment="Center" VerticalAlignment="Stretch" Orientation="Vertical" Grid.Column="4" Maximum="15" LargeChange="3" SmallChange="1" Grid.Row="2" x:Name="sli125" Minimum="-15"/>
		<Slider IsEnabled="False" Style="{StaticResource EqualizerSliderTemplate}" HorizontalAlignment="Center" VerticalAlignment="Stretch" Orientation="Vertical" Grid.Column="5" Maximum="15" LargeChange="3" SmallChange="1" Grid.Row="2" x:Name="sli250" Minimum="-15"/>
		<Slider IsEnabled="False" Style="{StaticResource EqualizerSliderTemplate}" HorizontalAlignment="Center" VerticalAlignment="Stretch" Orientation="Vertical" Grid.Column="6" Maximum="15" LargeChange="3" SmallChange="1" Grid.Row="2" x:Name="sli500" Minimum="-15"/>
		<Slider IsEnabled="False" Style="{StaticResource EqualizerSliderTemplate}" HorizontalAlignment="Center" VerticalAlignment="Stretch" Orientation="Vertical" Grid.Column="7" Maximum="15" LargeChange="3" SmallChange="1" Grid.Row="2" x:Name="sli1K" Minimum="-15"/>
		<Slider IsEnabled="False" Style="{StaticResource EqualizerSliderTemplate}" HorizontalAlignment="Center" VerticalAlignment="Stretch" Orientation="Vertical" Grid.Column="8" Maximum="15" LargeChange="3" SmallChange="1" Grid.Row="2" x:Name="sli2K" Minimum="-15"/>
		<Slider IsEnabled="False" Style="{StaticResource EqualizerSliderTemplate}" HorizontalAlignment="Center" VerticalAlignment="Stretch" Orientation="Vertical" Grid.Column="9" Maximum="15" LargeChange="3" SmallChange="1" Grid.Row="2" x:Name="sli4K" Minimum="-15"/>
		<Slider IsEnabled="False" Style="{StaticResource EqualizerSliderTemplate}" HorizontalAlignment="Center" VerticalAlignment="Stretch" Orientation="Vertical" Grid.Column="10" Maximum="15" LargeChange="3" SmallChange="1" Grid.Row="2" x:Name="sli8K" Minimum="-15"/>
		<Slider IsEnabled="False" Style="{StaticResource EqualizerSliderTemplate}" HorizontalAlignment="Center" VerticalAlignment="Stretch" Orientation="Vertical" Grid.Column="11" Maximum="15" LargeChange="3" SmallChange="1" Grid.Row="2" x:Name="sli16K" Minimum="-15"/>
		<CheckBox HorizontalAlignment="Left" VerticalAlignment="Center" Content="On" FontWeight="Bold" Foreground="{DynamicResource VOColor1A}" x:Name="chkOn"/>
		<ComboBox IsEnabled="False" IsSynchronizedWithCurrentItem="True" HorizontalAlignment="Stretch" VerticalAlignment="Top" Grid.Column="1" Grid.ColumnSpan="5" x:Name="cboPresets">
		</ComboBox>
		<TextBlock VerticalAlignment="Top" Text="{x:Static properties:Globalization.Equalizer_Preamp}" TextWrapping="Wrap" Grid.Row="3" Foreground="{DynamicResource VOColor1A}"/>
		<TextBlock VerticalAlignment="Top" Text="{x:Static properties:Globalization.Equalizer_Balance}" TextWrapping="Wrap" Grid.Row="3" Grid.Column="1" Foreground="{DynamicResource VOColor1A}"/>
		<TextBlock VerticalAlignment="Center" Text="32" TextWrapping="Wrap" Grid.Row="3" Grid.Column="2" HorizontalAlignment="Center" Foreground="{DynamicResource VOColor1A}"/>
		<TextBlock VerticalAlignment="Center" Text="64" TextWrapping="Wrap" Grid.Row="3" Grid.Column="3" HorizontalAlignment="Center" Foreground="{DynamicResource VOColor1A}"/>
		<TextBlock VerticalAlignment="Center" Text="125" TextWrapping="Wrap" Grid.Row="3" Grid.Column="4" HorizontalAlignment="Center" Foreground="{DynamicResource VOColor1A}"/>
		<TextBlock VerticalAlignment="Center" Text="250" TextWrapping="Wrap" Grid.Row="3" Grid.Column="5" HorizontalAlignment="Center" Foreground="{DynamicResource VOColor1A}"/>
		<TextBlock VerticalAlignment="Center" Text="500" TextWrapping="Wrap" Grid.Row="3" Grid.Column="6" HorizontalAlignment="Center" Foreground="{DynamicResource VOColor1A}"/>
		<TextBlock VerticalAlignment="Center" Text="1 K" TextWrapping="Wrap" Grid.Row="3" Grid.Column="7" HorizontalAlignment="Center" Foreground="{DynamicResource VOColor1A}"/>
		<TextBlock VerticalAlignment="Center" Text="2 K" TextWrapping="Wrap" Grid.Row="3" Grid.Column="8" HorizontalAlignment="Center" Foreground="{DynamicResource VOColor1A}"/>
		<TextBlock VerticalAlignment="Center" Text="4 K" TextWrapping="Wrap" Grid.Row="3" Grid.Column="9" HorizontalAlignment="Center" Foreground="{DynamicResource VOColor1A}"/>
		<TextBlock VerticalAlignment="Center" Text="8 K" TextWrapping="Wrap" Grid.Row="3" Grid.Column="10" HorizontalAlignment="Center" Foreground="{DynamicResource VOColor1A}"/>
		<TextBlock VerticalAlignment="Center" Text="16 K" TextWrapping="Wrap" Grid.Row="3" Grid.Column="11" HorizontalAlignment="Center" Foreground="{DynamicResource VOColor1A}"/>
	</Grid>
</UserControl>
